<template>
  <div>
    <!-- 面包屑 -- 全局组件 -->
    <BreadCrumb />
    <!-- 添加按钮 -->
    <el-button type="primary" plain class="m20" @click="add">添加</el-button>
    <!-- 列表 - 组件 -->
    <List @edit="editItem"></List>
    <!-- 弹窗组件 -->
    <Dialog
      :isShow="isShow"
      :isAdd="isAdd"
      @cancel="cancel"
      ref="dialog"
    ></Dialog>
  </div>
</template>

<script setup>
import List from './list'
import Dialog from './dialog'
import {ref} from 'vue'
const isShow = ref(false)
const isAdd = ref(true)
const add = ()=>{
    isShow.value = true
}
const cancel = ()=>{
    isShow.value = false
}
const dialog = ref()
// 编辑
const editItem =(uid)=>{
    isShow.value = true
    isAdd.value = false
    dialog.value.lookup(uid)
}
</script>

<style>
</style>